<?php


namespace app\api\controller;

use app\common\controller\Api;
use think\Request;
use app\common\model\ads\Ads as AdsModel;

class Ads extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    public  function getAdsInfo(Request $request){
        $ads_sign=$request->param("ads_sign");
        $res=AdsModel::getAds($ads_sign);
        $this->success('广告信息获取成功',$res);
    }

    public function addClick(Request $request){
        $ads_id=$request->param("ads_id");
        $res=AdsModel::addClick($ads_id);
        if($res===false) $this->error("点击量添加失败");
        $this->success("操作成功");
    }
}